#include<iostream>
#include <memory>
#include<string>
#include <sys/epoll.h>
#include "Connection.hpp"
#include"Log.hpp"
#include"Reactor.hpp"
#include"Listener.hpp"
#include"Connection.hpp"
using namespace LogModule;

int main(int argc,char *argv[])
{
    if(argc != 2)
    {
        std::cout << "Usage :" << argv[0] << " port" << std::endl;
    }                                                                                                                                                              
    ENABLE_CONSOLE();//将日志信息打印在显示器上
    uint16_t local_port = std::stoi(argv[1]);

    Reactor epoll_svr;
    auto con = std::make_shared<Listener>(local_port);
    
    epoll_svr.InsertConnection(con);
    epoll_svr.Loop();
   
}